/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pa165.bookingmanager.dto;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Radek Koubsky
 */
@XmlRootElement
public class HotelDTO {

    private Long id;
    private String name;
    private String adress;
    private List<RoomDTO> rooms = null;
    private String description;
    private String city;

    public List<RoomDTO> getRooms() {
        if (this.rooms == null) {
            return null;
        }

        return Collections.unmodifiableList(this.rooms);
    }

    public void setRooms(List<RoomDTO> rooms) {
        this.rooms = null;

        if (rooms != null) {
            this.rooms = new ArrayList<RoomDTO>();
            this.rooms.addAll(rooms);
        }
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAdress() {
        return adress;
    }

    public void setAdress(String adress) {
        this.adress = adress;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof HotelDTO)) {
            return false;
        }
        HotelDTO other = (HotelDTO) object;
        if ((this.id == null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "HotelDTO{" + "id=" + id + ", name=" + name + ", adress=" + adress + ", rooms=" + rooms + ", description=" + description + ", city=" + city + '}';
    }
}
